﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EmployeesDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            Employee[] employees = new Employee[5];

            for (int i = 0; i < 5; i++)
            {
                Employee newEmployee = new Employee();
                newEmployee.AddEmployeeInfo();
                employees[i] = newEmployee;
            }

            int sumOfSalary = 0;
            foreach (var employee in employees)
            {
                sumOfSalary += employee.salary;
            }

            Console.WriteLine("Суммарная зп: {0}", sumOfSalary);

        }
    }

    class Employee
    {
        public string firstName;
        public string lastName;
        public int salary;

        public void AddEmployeeInfo()
        {
            Console.WriteLine("Введите имя:");
            firstName = Console.ReadLine();
            Console.WriteLine("Введите Фамилию:");
            lastName = Console.ReadLine();
            Console.WriteLine("Введите размер ЗП:");
            salary = Int32.Parse(Console.ReadLine());
        }

        public void ShowEmployeeInfo()
        {
            Console.WriteLine("{0} {1}", firstName, lastName);
        }

    }
}